﻿using Dapper;
using System.Data;
using YAPACS.RisServer.Services.ECharts;

namespace YAPACS.RisServer.Abstractions;

public interface IChartService
{
    /// <summary>
    /// 数据源填充
    /// </summary>
    /// <param name="connection">IDbConnection</param>
    /// <param name="parameters">sql 参数</param>
    /// <param name="categories">类目集合</param>
    /// <param name="sqlStr"> Sql语句</param>
    /// <param name="granularity">统计粒度</param>
    /// <param name="source">数据源source属性对象</param>
    /// <returns></returns>
    List<object> FillDataSource(IDbConnection connection, DynamicParameters parameters, List<Category> categories, string sqlStr, string seriesName, List<object> source);

    /// <summary>
    /// 获取时间划分的类目集合
    /// </summary>
    List<Category> GetCategories(DateTime startTime, DateTime endTime, string granularity);

    /// <summary>
    /// 获取月份类目
    /// </summary>
    List<Category> GetMonthsBetween(DateTime startTime, DateTime endTime);

    /// <summary>
    /// 获取周类目
    /// </summary>
    List<Category> GetWeeksBetween(DateTime startTime, DateTime endTime);

    /// <summary>
    /// 获取天类目
    /// </summary>
    List<Category> GetDaysBetween(DateTime startTime, DateTime endTime);

    /// <summary>
    /// 获取用户信息
    /// </summary>
    /// <param name="stationCode"></param>
    /// <returns></returns>
    Task<object> GetUserInfo(string stationCode);
}
